#ifndef __HAL_7_SEG_H__
#define __HAL_7_SEG_H__

#include <stdint.h>

#define sa 0x01
#define sb 0x02
#define sc 0x04
#define sd 0x08
#define se 0x10
#define sf 0x20
#define sg 0x40
#define sp 0x80

#define CHARACTOR_SPACE 0

#define CHARACTOR_A (sa+sb+sc+se+sf+sg)
#define CHARACTOR_B (sc+sd+se+sf+sg)
#define CHARACTOR_C (sa+sd+se+sf)
#define CHARACTOR_D (sb+sc+sd+se+sg)
#define CHARACTOR_E (sa+sd+se+sf+sg)
#define CHARACTOR_F (sa+se+sf+sg)
#define CHARACTOR_G (sa+sc+sd+se+sf)
#define CHARACTOR_H (sb+sc+se+sf+sg)
#define CHARACTOR_I (sc)
#define CHARACTOR_J (sb+sc+sd)
#define CHARACTOR_K (sa+sc+se+sf+sg)
#define CHARACTOR_L (sd+se+sf)
#define CHARACTOR_M (sa+sc+se+sg)
#define CHARACTOR_N (sc+se+sg)
#define CHARACTOR_O (sc+sd+se+sg)
#define CHARACTOR_P (sa+sb+se+sf+sg)
#define CHARACTOR_Q (sa+sb+sc+sf+sg)
#define CHARACTOR_R (sa+se+sf)
#define CHARACTOR_r (se+sg)
#define CHARACTOR_S (sa+sc+sd+sf+sg)
#define CHARACTOR_T (sd+se+sf+sg)
#define CHARACTOR_U (sb+sc+sd+se+sf)
#define CHARACTOR_V (sb+sc+sd)
#define CHARACTOR_W (sb+sc+sd+se+sf+sg)
#define CHARACTOR_X (sc+sf+sg)
#define CHARACTOR_Y (sb+sc+sd+sf+sg)
#define CHARACTOR_Z (sa+sb+sd+se+sg)

#define CHARACTOR_a (sa+sb+sc+se+sf+sg)
#define CHARACTOR_b (sc+sd+se+sf+sg)
#define CHARACTOR_c (sa+sd+se+sf)
#define CHARACTOR_d (sb+sc+sd+se+sg)
#define CHARACTOR_e (sa+sd+se+sf+sg)
#define CHARACTOR_f (sa+se+sf+sg)
#define CHARACTOR_g (sa+sc+sd+se+sf)
#define CHARACTOR_h (sb+sc+se+sf+sg)
#define CHARACTOR_i (sc)
#define CHARACTOR_j (sb+sc+sd)
#define CHARACTOR_k (sa+sc+se+sf+sg)
#define CHARACTOR_l (sd+se+sf)
#define CHARACTOR_m (sa+sc+se+sg)
#define CHARACTOR_n (sc+se+sg)
#define CHARACTOR_o (sc+sd+se+sg)
#define CHARACTOR_p (sa+sb+se+sf+sg)
#define CHARACTOR_q (sa+sb+sc+sf+sg)
#define CHARACTOR_r (se+sg)
#define CHARACTOR_s (sa+sc+sd+sf+sg)
#define CHARACTOR_t (sd+se+sf+sg)
#define CHARACTOR_u (sb+sc+sd+se+sf)
#define CHARACTOR_v (sb+sc+sd)
#define CHARACTOR_w (sb+sc+sd+se+sf+sg)
#define CHARACTOR_x (sc+sf+sg)
#define CHARACTOR_y (sb+sc+sd+sf+sg)
#define CHARACTOR_z (sa+sb+sd+se+sg)


#define CHARACTOR_0 0x3F
#define CHARACTOR_1 0x06
#define CHARACTOR_2 0x5B
#define CHARACTOR_3 0x4F
#define CHARACTOR_4 0x66
#define CHARACTOR_5 0x6D
#define CHARACTOR_6 0x7D
#define CHARACTOR_7 0x27
#define CHARACTOR_8 0x7F
#define CHARACTOR_9 0x6F

void HAL_7Seg_Init(void);
void HAL_7Seg_SetData(int16_t data, uint8_t digi);
void HAL_7Seg_SetText(uint8_t t1, uint8_t t2, uint8_t t3);
void HAL_7Seg_SetIndex(uint8_t t, uint8_t index);
void HAL_7Seg_SetByte(uint8_t data, uint8_t byte);
void HAL_7Seg_SetDot(uint8_t dot_bit);
void HAL_7Seg_Display(void);
void testdeg(void);

#endif

